﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Public Class ReporteFact
    Public Shared Function Build(ByVal dr As OdbcDataReader) As ReporteBE
        Dim tmpReporte As ReporteBE = New ReporteBE()
        Try
            With tmpReporte
                .Autoriza = convertDTFromDb.ConvertString(dr.Item("Autoriza"))
                .Cantidad = convertDTFromDb.ConvertString(dr.Item("Cantidad"))
                .Clave = convertDTFromDb.ConvertString(dr.Item("Clave"))
                .Descripcion = convertDTFromDb.ConvertString(dr.Item("Descripcion"))
                .Descuento = convertDTFromDb.ConvertString(dr.Item("Descuento"))
                .Familia = convertDTFromDb.ConvertString(dr.Item("Descuento"))
                .Fecha = convertDTFromDb.ConvertString(dr.Item("Fecha"))
                .FechaEntrega = convertDTFromDb.ConvertString(dr.Item("FechaEntrega"))
                .FechaReq = convertDTFromDb.ConvertString(dr.Item("FechaReq"))
                .Importe = convertDTFromDb.ConvertString(dr.Item("Importe"))
                .Moneda = convertDTFromDb.ConvertString(dr.Item("Moneda"))
                .NumDoc = convertDTFromDb.ConvertString(dr.Item("NumDoc"))
                .NumReq = convertDTFromDb.ConvertString(dr.Item("NumReq"))
                .Precio = convertDTFromDb.ConvertString(dr.Item("Precio"))
                .ProdServ = convertDTFromDb.ConvertString(dr.Item("ProdServ"))
                .Proveedor = convertDTFromDb.ConvertString(dr.Item("Proveedor"))
                .Referencia = convertDTFromDb.ConvertString(dr.Item("Referencia"))
                .Solicita = convertDTFromDb.ConvertString(dr.Item("Solicita"))
                .Status = convertDTFromDb.ConvertString(dr.Item("Status"))
                .Sugerida = convertDTFromDb.ConvertString(dr.Item("Sugerida"))
                .Tipo = convertDTFromDb.ConvertString(dr.Item("Tipo"))
                .UniMed = convertDTFromDb.ConvertString(dr.Item("UniMed"))
            End With
            Return tmpReporte
        Catch ex As Exception
            Throw
        Finally
            tmpReporte = Nothing
        End Try
    End Function
End Class
